You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
require an explicit three-maintainer allowlist for manually dispatched AI review, translation, and TOC synchronization jobs
validate both the original actor and the rerun initiator for manual workflow runs
allow scheduled translations without an actor check only on their first attempt; require an allowlisted initiator for reruns
remove inactive accounts from the existing ZH-to-EN synchronization allowlist
retain the repository guard for privileged jobs
pass the workflow token to GitHub CLI through GH_TOKEN instead of placing it in a curl authorization argument
This prevents repository writers outside the current maintainer set from manually running or rerunning jobs that use provider secrets or write repository content, and keeps the workflow token out of process arguments.
Validation:
parsed all five modified workflow files as YAML
ran git diff --check
verified the manual-dispatch, scheduled-event, rerun, and token-handling paths
Which TiDB version(s) do your changes apply to? (Required)
master (the latest development version)
v9.0 (TiDB 9.0 versions)
v8.5 (TiDB 8.5 versions)
v8.1 (TiDB 8.1 versions)
v7.5 (TiDB 7.5 versions)
v7.1 (TiDB 7.1 versions)
v6.5 (TiDB 6.5 versions)
What is the related PR or file link(s)?
Related code change PR links (if applicable): N/A
This PR is translated from: N/A
Other reference link(s): N/A
AI agent involvement
The changes in this PR were primarily made by an AI agent on behalf of the PR author.
Do your changes match any of the following descriptions?
Delete files
Change aliases
Need modification after applied to another branch
Might cause conflicts after applied to another branch
Reviewing files that changed from the base of the PR and between 2af75a9 and 416fbf8.
Files selected for processing: 5
.github/workflows/doc_review.yml
.github/workflows/sync-cloud-zh-toc.yml
.github/workflows/sync-doc-pr-zh-to-en.yml
.github/workflows/translation-cron.yml
.github/workflows/translation-zh.yaml
Note
Reviews paused
It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.
No actionable comments were generated in the recent review.
Walkthrough
Five GitHub Actions jobs now use updated repository, event, or actor conditions. The changes restrict job execution based on configured actors and, for translation jobs, distinguish scheduled runs from manual dispatches.
Changes: Workflow execution conditions
Layer / File(s)
Summary
Job trigger and actor conditions .github/workflows/doc_review.yml, .github/workflows/sync-cloud-zh-toc.yml, .github/workflows/translation-cron.yml, .github/workflows/translation-zh.yaml, .github/workflows/sync-doc-pr-zh-to-en.yml
The review job checks the repository and restricts dispatch and matching comment events to listed actors. The TOC sync job adds actor checks. Translation jobs distinguish scheduled runs from manual dispatches and apply actor checks. The document sync job updates its actor allowlist and checks both the actor and triggering actor.
This change restricts manual dispatch and rerun of the privileged documentation workflows to three maintainers, and it closes the rerun bypass. A remaining limit is that a writer could still dispatch an older or custom branch version of a workflow that lacks these checks. Closing that needs repository settings such as protected environments, so it is a bounded follow-up rather than a reason to hold this PR.
Pre-merge checks: 4
Check name
Status
Explanation
Title check
The title clearly and concisely describes the main change: restricting privileged workflow triggers.
Linked Issues check
Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check
Check skipped because no linked issues were found for this pull request.
Description check
The pull request description is complete. It explains the changes, affected TiDB version, validation performed, AI agent involvement, and applicable change categories. Optional reference links and fir…
Full details: Description check
Explanation
The pull request description is complete. It explains the changes, affected TiDB version, validation performed, AI agent involvement, and applicable change categories. Optional reference links and first-time contributor details are addressed or not applicable.
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
Reviewing files that changed from the base of the PR and between f13a0e6 and 2af75a9.
Files selected for processing: 5
.github/workflows/doc_review.yml
.github/workflows/sync-cloud-zh-toc.yml
.github/workflows/sync-doc-pr-zh-to-en.yml
.github/workflows/translation-cron.yml
.github/workflows/translation-zh.yaml
Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 1 remain after this review.
Reviewing files that changed from the base of the PR and between 16b9550 and f3b82c6.
Files selected for processing: 4
.github/workflows/doc_review.yml
.github/workflows/sync-cloud-zh-toc.yml
.github/workflows/translation-cron.yml
.github/workflows/translation-zh.yaml
Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 3 remain after this review.
GitHub Actions workflow_dispatch select branch workflow version run branch ref write access workflow_dispatch secrets default branch workflow exists
Result:
Sources consulted:
- Manually running a workflow — https://docs.github.com/en/actions/how-tos/manage-workflow-runs/manually-run-a-workflow
- Triggering a workflow — https://docs.github.com/en/actions/how-tos/write-workflows/choose-when-workflows-run/trigger-a-workflow
- Events that trigger workflows — https://docs.github.com/en/actions/reference/workflows-and-actions/events-that-trigger-workflows
- Workflow syntax for GitHub Actions — https://docs.github.com/en/actions/reference/workflows-and-actions/workflow-syntax
- GitHub workflow | Port — https://docs.port.io/workflows/actions-and-automations/setup-backend/github-workflow/
Script executed:
printf'%s\n''--- available refs containing old workflow ---'
git for-each-ref --format='%(refname)' refs/heads refs/remotes refs/tags |while IFS= read -r ref;do
oid=$(git rev-parse "$ref:.github/workflows/sync-cloud-zh-toc.yml"2>/dev/null)||continue
old=$(git rev-parse '16b9550da30e6feba95243d0e6b5ddbd859ab3c4:.github/workflows/sync-cloud-zh-toc.yml')||exit 1
if [ "$oid"="$old" ];thenprintf'%s\n'"$ref";fidoneprintf'%s\n''--- base workflow ---'
git show 16b9550da30e6feba95243d0e6b5ddbd859ab3c4:.github/workflows/sync-cloud-zh-toc.yml | cat -n | sed -n '1,60p'printf'%s\n''--- current translation entrypoints ---'
cat -n .github/workflows/translation-cron.yml | sed -n '1,85p'
cat -n .github/workflows/translation-zh.yaml | sed -n '1,75p'
Repository: pingcap/docs
Length of output: 10147
Web query:
GitHub Actions workflow_dispatch uses workflow file version branch ref workflow file selected branch version documentation
Result:
Sources consulted:
- Events that trigger workflows — https://docs.github.com/en/actions/reference/workflows-and-actions/events-that-trigger-workflows
- Workflow syntax for GitHub Actions — https://docs.github.com/en/actions/reference/workflows-and-actions/workflow-syntax
- Manually running a workflow — https://docs.github.com/en/actions/how-tos/manage-workflow-runs/manually-run-a-workflow
- Triggering a workflow — https://docs.github.com/en/actions/how-tos/write-workflows/choose-when-workflows-run/trigger-a-workflow
- Workflows — https://docs.github.com/en/actions/concepts/workflows-and-actions/workflows
Script executed:
printf'%s\n''--- repository and ref metadata ---'
git status --short --branch
git remote -v
printf'%s\n''--- public branch and ruleset metadata ---'ifcommand -v gh >/dev/null 2>&1;then
gh api 'repos/pingcap/docs/branches?per_page=100' --jq '.[] | [.name, .protected, .commit.sha] | @tsv'
gh api 'repos/pingcap/docs/rulesets?includes_parents=true&per_page=100' --jq '.[] | [.name, .target, .enforcement] | @tsv'elseprintf'%s\n''gh unavailable'fi
Repository: pingcap/docs
Length of output: 7882
Script executed:
forrefin cloud-webhook-payload-reference docs/clarify-backup-delay-scaling Benjamin2037-patch-1;doprintf'\n--- %s ---\n'"$ref"
gh api -X GET 'repos/pingcap/docs/contents/.github/workflows/sync-cloud-zh-toc.yml' -f "ref=$ref" --jq '.content | @base64d'| cat -n | sed -n '1,60p'done
Repository: pingcap/docs
Length of output: 741
Script executed:
forrefin agent-memory-guide-2026-10 cloud/add-release-note-20261027 fix-filesystem-quick-start automation/keyword-sync-docs-master-b254c43931d9;doprintf'\n--- %s ---\n'"$ref"
gh api -X GET 'repos/pingcap/docs/contents/.github/workflows/sync-cloud-zh-toc.yml' -f "ref=$ref" --jq '.content | @base64d'| cat -n | sed -n '1,20p'done
Repository: pingcap/docs
Length of output: 1249
Script executed:
gh api -X GET 'repos/pingcap/docs/contents/.github/workflows/sync-cloud-zh-toc.yml' -f 'ref=automation/keyword-sync-docs-master-b254c43931d9' --jq '.content | @base64d'| cat -n | sed -n '1,90p'
Repository: pingcap/docs
Length of output: 3463
Script executed:
forfilein translation-cron.yml translation-zh.yaml;doprintf'\n--- %s ---\n'"$file"
gh api -X GET "repos/pingcap/docs/contents/.github/workflows/$file" -f 'ref=automation/keyword-sync-docs-master-b254c43931d9' --jq '.content | @base64d'| cat -n | sed -n '1,75p'done
Repository: pingcap/docs
Length of output: 5782
Enforce the allowlist outside dispatchable workflow versions.
A writer outside the allowlist can dispatch the existing automation/keyword-sync-docs-master-b254c43931d9 branch. Its TOC workflow lacks the check and requests write permissions and GEMINI_API_TOKEN. The same branch also has translation workflows without the actor checks.
Enforce the privileged boundary outside the selectable workflow version.
The reason will be displayed to describe this comment to others. Learn more.
Valid architectural limitation. A condition inside a workflow cannot protect against a writer selecting or creating another branch whose workflow omits that condition. Closing that boundary requires a repository-admin control outside the selectable workflow version, such as moving provider secrets to a protected GitHub Environment with deployment-branch restrictions and required reviewers, together with tighter write access. Adding environment: in this PR without configuring and migrating the repository secrets would not enforce the boundary, so this PR keeps the scoped default-branch authorization fix and does not claim to solve hostile workflow versions.
The reason will be displayed to describe this comment to others. Learn more.
@lilin90 Understood. This PR limits dispatches of the updated workflow, but it does not protect secrets or write access from other selectable workflow versions.
Would you like me to open a follow-up issue for the repository-admin controls?
Learnings added
Learnt from: lilin90
Repo: pingcap/docs PR: 24677
File: .github/workflows/sync-cloud-zh-toc.yml:0-0
Timestamp: 2026-11-11T08:50:08.529Z
Learning: Within repository "pingcap/docs", only for files matching one of [".github/workflows/sync-cloud-zh-toc.yml"]: When a change to `.github/workflows/sync-cloud-zh-toc.yml` claims to restrict privileged manual dispatch, check whether other selectable workflow versions can access the same secrets or write permissions without the actor check. Verify controls outside those workflow versions rather than treating a job condition or an `environment:` declaration alone as a complete boundary.
Note: Learnings are effective only in the context of similar code segments. To apply general coding guidelines, please configure review instructions. You can manage existing learnings in the app.
ti-chi-botBot
added
size/M
Denotes a PR that changes 30-99 lines, ignoring generated files.
and removed
size/S
Denotes a PR that changes 10-29 lines, ignoring generated files.
labels
Nov 11, 2026
Reviewing files that changed from the base of the PR and between f3b82c6 and f13a0e6.
Files selected for processing: 4
.github/workflows/sync-cloud-zh-toc.yml
.github/workflows/sync-doc-pr-zh-to-en.yml
.github/workflows/translation-cron.yml
.github/workflows/translation-zh.yaml
Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 2 remain after this review.
This pull request hardens privileged documentation workflows by restricting manual runs and reruns to an explicit three-maintainer allowlist while preserving first-attempt scheduled translation runs.
Changes:
Adds actor and rerun-initiator authorization checks to translation, AI review, and TOC synchronization workflows.
Removes inactive accounts from the ZH-to-EN synchronization allowlist.
The ZH-to-EN synchronization workflow still lacks the canonical repository guard.
File
Description
.github/workflows/translation-zh.yaml
Restricts scheduled and manually dispatched Chinese translation jobs using maintainer and rerun authorization checks.
.github/workflows/translation-cron.yml
Restricts scheduled and manually dispatched Japanese translation jobs using maintainer and rerun authorization checks.
.github/workflows/sync-doc-pr-zh-to-en.yml
Updates the ZH-to-EN synchronization allowlist and rerun authorization checks.
.github/workflows/sync-cloud-zh-toc.yml
Restricts Cloud TOC synchronization to the canonical repository and approved maintainers.
.github/workflows/doc_review.yml
Restricts manual and comment-triggered AI documentation reviews to approved maintainers.
Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.
The reason will be displayed to describe this comment to others. Learn more.
🔵 Needs a closer look
Static review found no actionable defect, but approval should wait for GitHub-side validation of actor, triggering_actor, and run_attempt behavior across privileged workflow dispatches and reruns.
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What is changed, added, or deleted? (Required)
GH_TOKENinstead of placing it in acurlauthorization argumentThis prevents repository writers outside the current maintainer set from manually running or rerunning jobs that use provider secrets or write repository content, and keeps the workflow token out of process arguments.
Validation:
git diff --checkWhich TiDB version(s) do your changes apply to? (Required)
What is the related PR or file link(s)?
AI agent involvement
Do your changes match any of the following descriptions?